package com.example.jqying.androiddemo.vistorPattern.vistor;

import com.example.jqying.androiddemo.vistorPattern.data.ConsumeBill;
import com.example.jqying.androiddemo.vistorPattern.data.IncomeBill;
import com.example.jqying.androiddemo.vistorPattern.vistorInterface.IAccountBookView;

/**
 * Created by apple on 2018/7/3.
 */

public class Boss implements IAccountBookView {
    private int income;
    private int consume;

    @Override
    public void view(ConsumeBill consumeBill) {
        consume += consumeBill.getAmount();
    }

    @Override
    public void view(IncomeBill incomeBill) {
        income += incomeBill.getAmount();
    }

    public int getIncome(){
        return  income;
    }

    public int getConsume(){
        return consume;
    }

    public String getResult(){
        return "Consume:"+consume+"---"+"Income:"+income;
    }
}
